{template "mheader.html"}

<div class="portlet light ">
    <div class="portlet-title tabbable-line">
        <ul class="nav nav-tabs" style="float:left;">
            {loop $module_memu $i $t}
            <li class="{if $mcid==$i}active{/if}">
                <a href="{$t.url}"> <i class="{$t.icon}"></i> {$t.name} </a>
            </li>
            {/loop}
        </ul>
    </div>
    <div class="portlet-body">

        <div class="margin-bottom-15 margin-top-10">
            <form action="{SELF}" method="get">
                {dr_form_search_hidden()}
                    <label>
                        <select name="field" class="form-control">
                            <option value="id"> Id </option>
                            {loop $field $t}
                            {if dr_is_admin_search_field($t) && $t.ismember}
                            <option value="{$t.fieldname}" {if $param.field==$t.fieldname}selected{/if}>{dr_lang($t.name)}</option>
                            {/if}
                            {/loop}
                        </select>
                    </label>
                    <label><i class="fa fa-caret-right"></i></label>
                    <label><input type="text" class="form-control" placeholder="" value="{$param['keyword']}" name="keyword" /></label>

                    <label><button type="submit" class="btn blue btn-sm " name="submit" > <i class="fa fa-search"></i> {dr_lang('搜索')}</button></label>

            </form>
        </div>

        <form class="form-horizontal" role="form" id="myform">
            {dr_form_hidden()}
            <div class="table-scrollable">
                <table class="table table-striped table-bordered table-hover table-checkable dataTable">
                    <thead>
                    <tr class="heading">
                        <th width="70" class="{dr_sorting('id')}" name="id"> Id </th>
                        <th class="{dr_sorting('title')}" name="title">主题</th>
                        <th width="150" class="{dr_sorting('catid')}" name="catid">栏目</th>
                        <th width="160" class="{dr_sorting('inputtime')}" name="inputtime">更新时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {loop $list $t}
                    <tr class="odd gradeX" id="dr_row_{$t.id}">
                        <td> <a href="{$t.url}" target="_blank">{$t.id}</a> </td>
                        <td> {Function_list::title($t['title'], $param, $t)} </td>
                        <td> {Function_list::catid($t['catid'])} </td>
                        <td> {Function_list::datetime($t['updatetime'], $param, $t)} </td>
                        <td>
                            {loop $clink $a}
                            {if $a.model && $a.check && method_exists($a.model, $a.check) && call_user_func(array($a.model, $a.check), APP_DIR, $t) == 0}
                            {php continue;}
                            {/if}
                            <label><a class="btn {if $a.color}{$a.color}{/if} btn-xs" href="{str_replace(array('{mid}', '{id}', '{cid}'), array(APP_DIR, $t.id, $t.id), $a.url)}"><i class="{$a.icon}"></i> {$a.name} {if $a.field} ({intval($t[$a['field']])}){/if} </a></label>
                            {/loop}
                            {loop $mform $a}
                            <label><a class="btn blue btn-xs" href="{dr_member_url(APP_DIR.'/'.$a.table.'/index', ['cid'=>$t.id])}"><i class="{dr_icon($a.setting.icon)}"></i> {dr_lang($a.name)} {if isset($t[$a.table.'_total'])} ({intval($t[$a.table.'_total'])}) {/if} </a></label>
                            {/loop}
                            {if $ci->content_model->check_member_auth($t.catid, 'edit')}
                            <label><a href="{dr_member_url($uriprefix.'/edit', ['id'=>$t.id])}" class="btn btn-xs blue"> <i class="fa fa-edit"></i> </a></label>
                            {/if}
                            {if $ci->content_model->check_member_auth($t.catid, 'del')}
                            <label><a href="javascript:dr_ajax_option('{dr_member_url($uriprefix.'/del', ['id'=>$t.id])}', '你确定要删除吗？', 1);" class="btn btn-xs red"> <i class="fa fa-trash"></i> </a></label>
                            {/if}
                        </td>
                    </tr>
                    {/loop}
                    </tbody>
                </table>
            </div>
        </form>

        {if $mypages}
        <div class="fc-pages text-center">{$mypages}</div>
        {/if}
    </div>
</div>



{template "mfooter.html"}